home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / zbpc_460.zip / DUALDEMO.EXE / DUO.DOC < prev    next >
Text File  |  1991-03-24  |  2KB  |  40 lines

  1. DUO.COM is an illustration of a dedicated operation multitasking program written in ZBASIC. DUO.BAS is simply a multitasking "shell" providing time slices to the executing code within each Task Section ... plus providing flow control when either task is completed and termination when both are completed.
  2.  
  3. The code within each task can be anything the programmer imagines ... though care obviously must be taken in use of variable names conflicting between tasks (until comfortable one might want to append a -1 to all variables in task 1 and a -2 in task 2). DUOTASK.BAS and DUOTASK1.BAS are advanced, practical examples of this concept.
  4.  
  5. In the example each task is terminated with a keypress, leaving the other task running until it is terminated by another keypress. Thus when both tasks are running the screen will read :
  6.  
  7. TASK1 Executing
  8. TASK2 Executing
  9. TASK1 Executing
  10. TASK2 Executing
  11. TASK1 Executing
  12. TASK2 Executing
  13. TASK1 Executing
  14. TASK2 Executing
  15. TASK1 Executing
  16. TASK2 Executing
  17. TASK1 Executing
  18. TASK2 Executing
  19. TASK1 Executing
  20. TASK2 Executing
  21.  
  22. then after a keypress
  23.  
  24. TASK1 Executing
  25. TASK1 Executing
  26. TASK1 Executing
  27. TASK1 Executing
  28. TASK1 Executing
  29. TASK1 Executing
  30. TASK1 Executing
  31. TASK1 Executing
  32. TASK1 Executing
  33. TASK1 Executing
  34.  
  35. (or TASK2 only)
  36.  
  37. This indicates that one task is closed and only the other is executing. The second keypress terminates the entire process.
  38.  
  39. DUODEMO.BAS includes a windowing version showing the executing sections in their own windows.
  40.